﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TreeBuilder
{
	public class NodeBinding
	{
		public List<INode> SourceNodes { get; private set; }
		public List<IBinder> Binders { get; private set; }

		public NodeBinding(IEnumerable<INode> sourceNodes, Func<IBinder> binderFactory)
		{
			SourceNodes = sourceNodes.ToList();
			Binders = SourceNodes.Select(x => binderFactory()).ToList();
			for (int i = 0; i < SourceNodes.Count; i++)
			{
				Binders[i].From = SourceNodes[i];
			}
		}


	}
}
